import { request } from '@/utils/request';
// import type { BaseResponse } from '@/utils/request';
import Api from '@/core/permission/modules/device/deviceManage';

export function getDeviceManageInfo(query: { id: string }) {
  return request<API.DeviceManageInfoResult>({
    url: Api.info,
    method: 'get',
    params: query,
  });
}

export function getDeviceManageList(query?: API.PageParams) {
  return request<API.DeviceManageListResult>({
    url: Api.list,
    method: 'get',
    params: query,
  });
}

export function createDeviceManage(data: API.CreateDeviceManageParams) {
  return request(
    {
      url: Api.add,
      method: 'post',
      data,
    },
    {
      successMsg: '创建成功',
    },
  );
}

export function editDeviceManage(data: API.UpdateDeviceManageParams) {
  return request(
    {
      url: Api.edit,
      method: 'post',
      data,
    },
    {
      successMsg: '更新成功',
    },
  );
}

export function deleteDeviceManage(data: string[]) {
  return request(
    {
      url: Api.delete,
      method: 'delete',
      data,
    },
    {
      successMsg: '删除成功',
    },
  );
}
